-
Notifications
You must be signed in to change notification settings - Fork 0
Psharma/django 5.0 fix #46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: stable/singlestore-django-5.0.x
Are you sure you want to change the base?
Psharma/django 5.0 fix #46
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request adds support for Django's db_default feature, which allows specifying database-level default values for model fields. The PR also upgrades the testing infrastructure to use Django 5.0.x and Python 3.11.
Key changes:
- Implements
db_default_sql()method and integrates it into column creation and field alteration logic - Updates test suite reference from Django 4.2.x to 5.0.x
- Adds test skips for db_default-related tests that involve unsupported complex expressions
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| django_singlestore/schema.py | Added db_default_sql() method and integrated db_default handling in column_sql(), add_field(), _alter_column_null_sql(), and _set_field_new_type() |
| django_singlestore/features.py | Enabled supports_db_default feature flag, added test skips for unsupported scenarios, and corrected a typo |
| README.md | Documented limitation regarding complex expressions in DEFAULT clauses |
| scripts/setup_sections/backends_setup.sql | Added a new M2M table definition for test purposes |
| .github/workflows/tests.yml | Updated Django ref to 5.0.x and Python version to 3.11 |
| .github/workflows/test_all_versions.yml | Updated Django ref to 5.0.x and Python version to 3.11 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
README.md
Outdated
| - `dumpdata` django command does not work if a table or a referenced m2m table does not have `id` column, which is the case for m2m tables created as suggested above (see `queries_paragraph_page` table definition). | ||
| - Fetching an instance of a custom through model using .objects.get() is not supported. | ||
| - Case-insensitive filter requires casting the filtered column to a `TextField` with case-insensitive collation, e.g. `utf8mb4_general_ci`. | ||
| - These complex expressions in `DEFAULT` clauses is not supported. SingleStore typically supports simple literal defaults (strings, numbers) and specific time functions like NOW() or CURRENT_TIMESTAMP() for datetime columns. |
Copilot
AI
Oct 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Grammatical error: 'These complex expressions' should be followed by 'are' not 'is'. Change 'is not supported' to 'are not supported'.
| - These complex expressions in `DEFAULT` clauses is not supported. SingleStore typically supports simple literal defaults (strings, numbers) and specific time functions like NOW() or CURRENT_TIMESTAMP() for datetime columns. | |
| - These complex expressions in `DEFAULT` clauses are not supported. SingleStore typically supports simple literal defaults (strings, numbers) and specific time functions like NOW() or CURRENT_TIMESTAMP() for datetime columns. |
2621958 to
537ee56
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
django_singlestore/schema.py:145
- The
column_sqlmethod returns an empty list for params on line 145, but whendb_defaultis handled (lines 110-114), params are accumulated in theparamslist. The return statement should bereturn ' '.join(result_sql_parts), paramsto properly return the accumulated params.
return " ".join(result_sql_parts), []
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
README.md
Outdated
| - `dumpdata` django command does not work if a table or a referenced m2m table does not have `id` column, which is the case for m2m tables created as suggested above (see `queries_paragraph_page` table definition). | ||
| - Fetching an instance of a custom through model using .objects.get() is not supported. | ||
| - Case-insensitive filter requires casting the filtered column to a `TextField` with case-insensitive collation, e.g. `utf8mb4_general_ci`. | ||
| - These complex expressions in `DEFAULT` clauses are not supported. SingleStore typically supports simple literal defaults (strings, numbers) and specific time functions like NOW() or CURRENT_TIMESTAMP() for datetime columns. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is meant by "these"? I'd say something like "Some complex expressions (e.g. , ) in DEFAULT ..." to give some examples
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please check the inline comments
We will keep the django singlestore backend for version 5.0 in branch as we can't use common skip_list and expected_failure in features.py for all version .